package sg.edu.nus.iss.billing.entity;

import java.math.BigDecimal;
import java.util.List;

import sg.edu.nus.iss.billing.entity.transaction.Transaction;

public class Account extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8804150113723479562L;
	private String accountNumber;
    private Customer customer;
	private transient List<Subscription> subscriptionList;
	private RecordState active;
	private transient List<Transaction> transactions;
	private transient List<PaymentHistory> paymentHistories;
	private BigDecimal balance = new BigDecimal(0);
	
	public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public String getAccountNumber() {
        return accountNumber;
    }

    public void setAccountNumber(String accountNumber) {
        this.accountNumber = accountNumber;
    }
    
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public List<Transaction> getTransactions() {
		return transactions;
	}

	public void setTransactions(List<Transaction> transactions) {
		this.transactions = transactions;
	}

	public List<PaymentHistory> getPaymentHistories() {
		return paymentHistories;
	}

	public void setPaymentHistories(List<PaymentHistory> paymentHistories) {
		this.paymentHistories = paymentHistories;
	}

	public List<Subscription> getSubscriptionList() {
		return subscriptionList;
	}

	public void setSubscriptionList(List<Subscription> subscriptionList) {
		this.subscriptionList = subscriptionList;
	}

	public void addSubscription(Subscription sub) {
		subscriptionList.add(sub);
	}

	public RecordState getActive() {
		return active;
	}

	public void setActive(RecordState active) {
		this.active = active;
	}

	@Override
	public String toString() {
		return "Account [accountNumber=" + accountNumber
				+ ", subscriptionList=" + subscriptionList + ", active="
				+ active + ", transactions=" + transactions
				+ ", paymentHistories=" + paymentHistories + ", balance="
				+ balance + "]";
	}

}
